home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 1
/
SPACE - Library 1 - Volume 1.iso
/
program
/
441
/
pdmaksrc.lzh
/
readenv.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-01-14
|
395b
|
22 lines
/*
* readenv() - set macro values from the environment
*/
#include <stdio.h>
readenv()
{
extern long _base;
char *envp, *p, *strchr();
char buf[256];
envp = *((char **) (_base + 0x2c));
for (; strncmp(envp, "ARGV=", 5) != 0 ; envp += strlen(envp) + 1) {
strcpy(buf, envp);
if ((p = strchr(buf, '=')) == NULL)
return;
*p++ = '\0';
setmacro(buf, p);
}
}